package com.struts2.example.model;

import java.sql.Connection;
import java.sql.DriverManager;

public class Connect {
	private Connection conn = null;
	private String URL = "jdbc:mysql://localhost/testonline_bang_dai";
	public Connection Connected() {

		try {
			
			Class.forName("com.mysql.jdbc.Driver");
			conn = DriverManager.getConnection(URL, "root", "123456");
			if (conn != null) {
				System.out.print("Connection is successful !");
				return conn;
			}
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
		return null;
	}
}
